var nodemodules = /node_modules/;

var path = require("path");

module.exports = {
    entry: './index.js',

    output: {
        path: 'public',
        filename: 'bundle.js',
        publicPath: '/',
        chunkFilename: '[name].[chunkhash:5].chunk.js'
    },

    module: {
        loaders: [
            {
                test: /\.js$/,
                exclude: nodemodules,
                loader: 'babel-loader?presets[]=es2015&presets[]=react'
            }
        ]
    },
    //
    devServer: {
        port: 3000,
        contentBase: "./public", //本地服务器所加载的页面所在的目录
        colors: true, //终端中输出结果为彩色
        historyApiFallback: true, //不跳转
        inline: true //实时刷新
    }
}